﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ProjectVLIB_LAB2
{
    public partial class frmConnConfig : Form
    {
        public frmConnConfig()
        {
            InitializeComponent();
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Hide();
            Form frmLogin = new frmLogin();
            frmLogin.Show();

        }

        private void frmConnConfig_Load(object sender, EventArgs e)
        {

        }

        private void btnConnect_Click(object sender, EventArgs e)
        {
            if (textServerName.Text == "localhost/SQLExpress" &
                textDatabase.Text == "VIDEO_LIB" &
                Cong.Text == "1433" &
                textUsername.Text == "sa" &
                  textPassword.Text == "sa"
                )
            {
                { MessageBox.Show("Kết nối dữ liệu thành công", "Chú Ý", MessageBoxButtons.OK, MessageBoxIcon.Information); }

            }
            else
            {

                { MessageBox.Show("Kết nối dữ liệu Không thành công", "Chú Ý", MessageBoxButtons.OK, MessageBoxIcon.Error); }

            }
        
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            { MessageBox.Show("Thông Tin đã Lưu", "Chú Ý", MessageBoxButtons.OK, MessageBoxIcon.Information); }
            this.Hide();
            Form frmLogin = new frmLogin();
            frmLogin.Show();
        }

        private void btnLoadConfigFile_Click(object sender, EventArgs e)
        {
            textServerName.Text = "localhost/SQLExpress";

            textServerName.Text = "localhost/SQLExpress" ;
                textDatabase.Text = "VIDEO_LIB" ;
                Cong.Text = "1433" ;
                textUsername.Text = "sa" ;
                  textPassword.Text = "sa";
        }
    }
}
